package com.stone.serverless.test2.controller;

import com.stone.serverless.event.domain.EventKey;
import com.stone.serverless.event.enums.EventTypeEnum;
import com.stone.serverless.test2.NeedOutServiceManager;
import com.stone.serverless.test2.domain.TestVO;
import com.stone.serverless.test2.service.Test2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: TODO
 * @Author: MECHREVO
 * @Date: 2022/1/13 9:53
 * @Version: 1.0.0
 */
@RestController
@RequestMapping(value = "/wee", method = RequestMethod.DELETE)
public class Test2Controller {

    @Autowired
    private Test2Service test2Service;

    @GetMapping("/test2")
    public TestVO test2() {
        TestVO testVO = new TestVO();
        //NeedOutServiceManager.INSTANCE.eventBusService.publish(EventKey.of("test", testVO, EventTypeEnum.LOCAL));
        test2Service.test2();
        testVO.setUserName("xx");
        return testVO;
        // test2Service.test2();
    }

    @GetMapping("/test3")
    public void test23() {
        System.out.println("x");

    }

}
